<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>Docker安装一些常用软件（更新中！） | 飞の博客</title><meta name="author" content="Fei"><meta name="copyright" content="Fei"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="Docker安装一些常用软件（更新中！）">
<meta property="og:type" content="article">
<meta property="og:title" content="Docker安装一些常用软件（更新中！）">
<meta property="og:url" content="https://tengfei2233.gitee.io/2023/6/26/Docker%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%9B%B4%E6%96%B0%E4%B8%AD-%EF%BC%89/index.html">
<meta property="og:site_name" content="飞の博客">
<meta property="og:description" content="Docker安装一些常用软件（更新中！）">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg">
<meta property="article:published_time" content="2023-06-26T06:19:33.000Z">
<meta property="article:modified_time" content="2023-07-31T07:00:00.000Z">
<meta property="article:author" content="Fei">
<meta property="article:tag" content="Docker">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg"><link rel="shortcut icon" href="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/icon.png"><link rel="canonical" href="https://tengfei2233.gitee.io/2023/6/26/Docker%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%9B%B4%E6%96%B0%E4%B8%AD-%EF%BC%89/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="msvalidate.01" content="2ADFA30867CBC6E090E3C5B244DC311D"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.3.0/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.staticfile.org/fancyapps-ui/4.0.31/fancybox.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?07a1f58fb95d3d4a97c2ae0a181c9964";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.staticfile.org/flickr-justified-gallery/2.1.2/fjGallery.min.js',
      css: 'https://cdn.staticfile.org/flickr-justified-gallery/2.1.2/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Docker安装一些常用软件（更新中！）',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-31 15:00:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>const preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> { preloader.endLoading() })

if (false) {
  document.addEventListener('pjax:send', () => { preloader.initLoading() })
  document.addEventListener('pjax:complete', () => { preloader.endLoading() })
}</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/fei.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">24</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">28</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://github.com/tengfei2233"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="飞の博客"><span class="site-name">飞の博客</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://github.com/tengfei2233"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Docker安装一些常用软件（更新中！）</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-06-26T06:19:33.000Z" title="发表于 2023-06-26 14:19:33">2023-06-26</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-31T07:00:00.000Z" title="更新于 2023-07-31 15:00:00">2023-07-31</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Docker/">Docker</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.6k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>7分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Docker安装一些常用软件（更新中！）"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="Docker安装一些常用软件（更新中！）"><a href="#Docker安装一些常用软件（更新中！）" class="headerlink" title="Docker安装一些常用软件（更新中！）"></a>Docker安装一些常用软件（更新中！）</h2><h4><font color=red>如果有防火墙，请自行打开，避免找了半天BUG( ╯□╰ )</font></h4>

<h5 id="下一篇Docker文章：Docker基础学习文档-包括安装教程"><a href="#下一篇Docker文章：Docker基础学习文档-包括安装教程" class="headerlink" title="下一篇Docker文章：Docker基础学习文档-包括安装教程"></a>下一篇Docker文章：<a target="_blank" rel="noopener" href="https://blog.tengfei.tech/2023/8/27/Docker%E5%9F%BA%E7%A1%80%E5%AD%A6%E4%B9%A0%E6%96%87%E6%A1%A3-%E5%8C%85%E6%8B%AC%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/"><font color="red">Docker基础学习文档-包括安装教程</font></a></h5><h3 id="一、安装MySQL8-0-22"><a href="#一、安装MySQL8-0-22" class="headerlink" title="一、安装MySQL8.0.22"></a>一、安装MySQL8.0.22</h3><h4 id="拉取mysql"><a href="#拉取mysql" class="headerlink" title="拉取mysql"></a>拉取mysql</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull mysql:8.0.22</span><br></pre></td></tr></table></figure>

<h4 id="新建目录"><a href="#新建目录" class="headerlink" title="新建目录"></a>新建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/mysql/data</span><br><span class="line">mkdir -p /data/mysql/conf</span><br><span class="line">mkdir -p /data/mysql/log</span><br></pre></td></tr></table></figure>

<h4 id="编写配置文件（日后待补充）"><a href="#编写配置文件（日后待补充）" class="headerlink" title="编写配置文件（日后待补充）"></a>编写配置文件（日后待补充）</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">vim /data/mysql/conf/my.cnf</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">添加以下内容</span></span><br><span class="line">[mysqld]</span><br><span class="line">init-connect=&quot;SET collation_connection=utf8mb4_0900_ai_ci&quot;</span><br><span class="line">init_connect=&quot;SET NAMES utf8mb4&quot;</span><br><span class="line">skip-character-set-client-handshake</span><br></pre></td></tr></table></figure>

<h4 id="执行脚本"><a href="#执行脚本" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name mysql8 \</span><br><span class="line">-v /data/mysql/log:/var/log/mysql \</span><br><span class="line">-v /data/mysql/data:/var/lib/mysql \</span><br><span class="line">-v /data/mysql/conf:/etc/mysql/conf.d \</span><br><span class="line">-p 3306:3306 \</span><br><span class="line">-e MYSQL_ROOT_PASSWORD=123456 \</span><br><span class="line">-d mysql:8.0.22</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h3 id="二、安装Redis6-2-12"><a href="#二、安装Redis6-2-12" class="headerlink" title="二、安装Redis6.2.12"></a>二、安装Redis6.2.12</h3><h4 id="拉取redis"><a href="#拉取redis" class="headerlink" title="拉取redis"></a>拉取redis</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull redis:6.2.12</span><br></pre></td></tr></table></figure>

<h4 id="新建目录-1"><a href="#新建目录-1" class="headerlink" title="新建目录"></a>新建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/redis/conf</span><br><span class="line">mkdir -p /data/redis/data</span><br></pre></td></tr></table></figure>

<h4 id="拷贝配置文件"><a href="#拷贝配置文件" class="headerlink" title="拷贝配置文件"></a>拷贝配置文件</h4><blockquote>
<p><font color=red>从网上下载对应版本的redis.conf配置文件，拷贝配置文件到&#x2F;data&#x2F;redis&#x2F;conf目录下</font></p>
<p><a target="_blank" rel="noopener" href="https://github.com/redis/redis">下载地址</a></p>
</blockquote>
<h4 id="修改redis-conf"><a href="#修改redis-conf" class="headerlink" title="修改redis.conf"></a>修改redis.conf</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">找到以下内容，进行修改</span></span><br><span class="line">bind 0.0.0.0 #运行外部访问</span><br><span class="line">daemonize no #这里一定要改成no，不要以守护线程模式运行，要不然容器在启动一瞬间就会ti</span><br><span class="line">requirepass 你的密码 #给redis设置密码（不建议0开头）</span><br><span class="line">appendonly yes #redis持久化　　默认是no</span><br><span class="line">tcp-keepalive 300 #防止出现远程主机强迫关闭了一个现有的连接的错误 默认是300</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="执行脚本-1"><a href="#执行脚本-1" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name redis6 \</span><br><span class="line">-p 6379:6379 \</span><br><span class="line">-v /data/redis/data:/data \</span><br><span class="line">-v /data/redis/conf/redis.conf:/etc/redis/redis.conf \</span><br><span class="line">-d redis:6.2.12 \</span><br><span class="line">redis-server /etc/redis/redis.conf</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h3 id="三、安装RabbitMQ3-9-4"><a href="#三、安装RabbitMQ3-9-4" class="headerlink" title="三、安装RabbitMQ3.9.4"></a>三、安装RabbitMQ3.9.4</h3><h4 id="拉取rabbitmq"><a href="#拉取rabbitmq" class="headerlink" title="拉取rabbitmq"></a>拉取rabbitmq</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull rabbitmq:3.10.24</span><br></pre></td></tr></table></figure>

<h4 id="新建目录-2"><a href="#新建目录-2" class="headerlink" title="新建目录"></a>新建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/rabbitmq/data</span><br><span class="line">mkdir -p /data/rabbitmq/plugins</span><br></pre></td></tr></table></figure>

<h4 id="执行脚本-2"><a href="#执行脚本-2" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name rabbitmq \</span><br><span class="line">-p 5672:5672 \</span><br><span class="line">-p 15672:15672 \</span><br><span class="line">-v /data/rabbitmq/data:/var/lib/rabbitmq \</span><br><span class="line">--hostname MasterRabbit \</span><br><span class="line">-e RABBITMQ_DEFAULT_VHOST=master  \</span><br><span class="line">-e RABBITMQ_DEFAULT_USER=admin \</span><br><span class="line">-e RABBITMQ_DEFAULT_PASS=123456 \</span><br><span class="line">-d rabbitmq:3.10.24</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">添加网页管理端插件</span></span><br><span class="line">docker exec -it rabbitmq rabbitmq-plugins enable rabbitmq_management</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h4 id="添加延迟队列插件"><a href="#添加延迟队列插件" class="headerlink" title="添加延迟队列插件"></a>添加延迟队列插件</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">插件下载地址：https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">一定要下载对应版本的</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将下载好的插件拷贝到/data/rabbitmq目录下</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将插件拷贝到容器内部</span></span><br><span class="line">docker cp /data/rabbitmq/插件名称 rabbitmq容器id:/plugins</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">进入容器内，安装插件</span></span><br><span class="line">docker exec -it rabbitmq容器id bash</span><br><span class="line">cd plugins</span><br><span class="line">rabbitmq-plugins enable rabbitmq_delayed_message_exchange</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">退出容器，重启</span></span><br><span class="line">docker restart rabbitmq容器id</span><br></pre></td></tr></table></figure>

<h3 id="四、安装Nginx"><a href="#四、安装Nginx" class="headerlink" title="四、安装Nginx"></a>四、安装Nginx</h3><h4 id="拉取nginx"><a href="#拉取nginx" class="headerlink" title="拉取nginx"></a>拉取nginx</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull nginx:stable</span><br></pre></td></tr></table></figure>

<h4 id="创建目录"><a href="#创建目录" class="headerlink" title="创建目录"></a>创建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/nginx/html</span><br><span class="line">mkdir -p /data/nginx/conf</span><br><span class="line">mkdir -p /data/nginx/log</span><br></pre></td></tr></table></figure>

<h4 id="拷贝文件"><a href="#拷贝文件" class="headerlink" title="拷贝文件"></a>拷贝文件</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">生成容器</span></span><br><span class="line">docker run --name nginx -p 80:80 -d nginx:stable</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将容器nginx.conf文件复制到宿主机</span></span><br><span class="line">docker cp nginx:/etc/nginx/nginx.conf /data/nginx/conf/nginx.conf</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将容器conf.d文件夹下内容复制到宿主机</span></span><br><span class="line">docker cp nginx:/etc/nginx/conf.d /data/nginx/conf/conf.d</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将容器中的html文件夹复制到宿主机</span></span><br><span class="line">docker cp nginx:/usr/share/nginx/html /data/nginx/</span><br></pre></td></tr></table></figure>

<h4 id="删除容器"><a href="#删除容器" class="headerlink" title="删除容器"></a>删除容器</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker stop nginx容器id</span><br><span class="line">docker rm nginx容器id</span><br></pre></td></tr></table></figure>

<h4 id="执行脚本-3"><a href="#执行脚本-3" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name nginx \</span><br><span class="line">-p 80:80 \</span><br><span class="line">-v /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \</span><br><span class="line">-v /data/nginx/conf/conf.d:/etc/nginx/conf.d \</span><br><span class="line">-v /data/nginx/log:/var/log/nginx \</span><br><span class="line">-v /data/nginx/html:/usr/share/nginx/html \</span><br><span class="line">-d nginx:stable</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h4 id="以下可选-配置SSL"><a href="#以下可选-配置SSL" class="headerlink" title="(以下可选*)配置SSL"></a><font color=red>(以下可选*)配置SSL</font></h4><p><font color=red>配置SSL需要更改执行脚本</font></p>
<figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">脚本改为（主要是多监听一个443端口）</span></span><br><span class="line">docker run \</span><br><span class="line">--name nginx \</span><br><span class="line">-p 80:80 \</span><br><span class="line">-p 443:443 \</span><br><span class="line">-v /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \</span><br><span class="line">-v /data/nginx/conf/conf.d:/etc/nginx/conf.d \</span><br><span class="line">-v /data/nginx/log:/var/log/nginx \</span><br><span class="line">-v /data/nginx/html:/usr/share/nginx/html \</span><br><span class="line">-d nginx:stable</span><br></pre></td></tr></table></figure>

<h4 id="配置相关信息"><a href="#配置相关信息" class="headerlink" title="配置相关信息"></a>配置相关信息</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">下载SSL文件</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在/data/nginx/conf/conf.d目录下创建cert文件夹</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">将xxx.pem与xxx.key文件拷贝进去</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">修改con.d目录下的default.conf</span></span><br></pre></td></tr></table></figure>

<ul>
<li>修改第一个server标签内的数据</li>
</ul>
<figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">监听端口</span></span><br><span class="line">listen       443;</span><br><span class="line"> listen  [::]:443;</span><br><span class="line"><span class="meta prompt_"> # </span><span class="language-bash">你的域名</span></span><br><span class="line"> server_name  tengfei.tech;</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"> #</span><span class="language-bash">ssl配置</span></span><br><span class="line"> ssl on;</span><br><span class="line"><span class="meta prompt_"> # </span><span class="language-bash">pem与key文件位置，相对于conf目录</span></span><br><span class="line"> ssl_certificate conf.d/cert/tengfei.tech.pem;</span><br><span class="line"> ssl_certificate_key conf.d/cert/tengfei.tech.key;</span><br><span class="line"></span><br><span class="line"> ssl_session_cache shared:SSL:1m;</span><br><span class="line"> ssl_session_timeout 5m;</span><br><span class="line"></span><br><span class="line"> ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;</span><br><span class="line"> ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;</span><br></pre></td></tr></table></figure>

<ul>
<li>增加一个server，用于在访问80端口时重定向到443端口（在第一个server下方添加一个server）</li>
</ul>
<figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">用于将http都从定向到https</span></span><br><span class="line">server &#123;</span><br><span class="line">    listen 80;</span><br><span class="line">    #填写证书绑定的域名</span><br><span class="line">    server_name tengfei.tech;</span><br><span class="line">    #将所有HTTP请求通过rewrite指令重定向到HTTPS。</span><br><span class="line">    rewrite ^(.*)$ https://$host$1;</span><br><span class="line">    location / &#123;</span><br><span class="line">        index index.html index.htm;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="五、安装Nacos2-1-2"><a href="#五、安装Nacos2-1-2" class="headerlink" title="五、安装Nacos2.1.2"></a>五、安装Nacos2.1.2</h3><h4 id="拉取nacos"><a href="#拉取nacos" class="headerlink" title="拉取nacos"></a>拉取nacos</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull nacos/nacos-server:v2.1.2</span><br></pre></td></tr></table></figure>

<h4 id="创建目录-1"><a href="#创建目录-1" class="headerlink" title="创建目录"></a>创建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/nacos/logs</span><br><span class="line">mkdir -p /data/nacos/conf</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">创建配置文件，写入配置</span></span><br><span class="line">touch /data/nacos/conf/application.properties</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">写入以下配置</span></span><br></pre></td></tr></table></figure>

<figure class="highlight properties"><table><tr><td class="code"><pre><span class="line"><span class="comment"># 基本配置</span></span><br><span class="line"><span class="attr">server.contextPath</span>=<span class="string">/nacos</span></span><br><span class="line"><span class="attr">server.servlet.contextPath</span>=<span class="string">/nacos</span></span><br><span class="line"><span class="attr">server.port</span>=<span class="string">8848</span></span><br><span class="line"><span class="comment"># 数据库配置（如果MySQL也安装在Docker内，则使用MySQL的在Docker上的Ip地址）</span></span><br><span class="line"><span class="comment"># 地址查询方式：docker inspect 容器|grep IPAddress</span></span><br><span class="line"><span class="attr">spring.datasource.platform</span>=<span class="string">mysql</span></span><br><span class="line"><span class="attr">db.num</span>=<span class="string">1</span></span><br><span class="line"><span class="attr">db.url.0</span>=<span class="string">jdbc:mysql://127.0.0.1:3306/nacos_config?serverTimezone=Asia/Shanghai&amp;characterEncoding=utf8&amp;connectTimeout=1000&amp;socketTimeout=3000&amp;autoReconnect=true #这里需要修改端口</span></span><br><span class="line"><span class="attr">db.user</span>=<span class="string">root</span></span><br><span class="line"><span class="attr">db.password</span>=<span class="string">123456</span></span><br><span class="line"><span class="comment"># 安全配置</span></span><br><span class="line"><span class="attr">nacos.core.auth.system.type</span>=<span class="string">nacos</span></span><br><span class="line"><span class="attr">nacos.core.auth.enabled</span>=<span class="string">true</span></span><br><span class="line"><span class="attr">nacos.core.auth.plugin.nacos.token.secret.key</span>=<span class="string">SecretKey012345678901234567890123456789012345678901234567890123456789</span></span><br><span class="line"><span class="attr">nacos.core.auth.server.identity.key</span>=<span class="string">example</span></span><br><span class="line"><span class="attr">nacos.core.auth.server.identity.value</span>=<span class="string">example</span></span><br></pre></td></tr></table></figure>

<h4 id="导入SQL（如果不使用MySQL的话这步可以忽略）"><a href="#导入SQL（如果不使用MySQL的话这步可以忽略）" class="headerlink" title="导入SQL（如果不使用MySQL的话这步可以忽略）"></a>导入SQL（如果不使用MySQL的话这步可以忽略）</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">找到nacos-config.sql文件，导入到外部mysql中</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">nacos-config.sql在nacos的github仓库有下载</span></span><br></pre></td></tr></table></figure>

<h4 id="执行脚本-4"><a href="#执行脚本-4" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name nacos \</span><br><span class="line">-p 8848:8848 \</span><br><span class="line">-p 9848:9848 </span><br><span class="line">-p 9849:9849</span><br><span class="line">--privileged=true \</span><br><span class="line">--restart=always \</span><br><span class="line">-e JVM_XMS=256m \</span><br><span class="line">-e JVM_XMX=256m \</span><br><span class="line">-e MODE=standalone \</span><br><span class="line">-e PREFER_HOST_MODE=hostname \</span><br><span class="line">-v /data/nacos/logs:/home/nacos/logs \</span><br><span class="line">-v /data/nacos/conf/application.properties:/home/nacos/conf/application.properties \</span><br><span class="line">-d  nacos/nacos-server:v2.1.2</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h4 id="访问"><a href="#访问" class="headerlink" title="访问"></a>访问</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">ip:8848/nacos</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">账号密码</span></span><br><span class="line">nacos</span><br><span class="line">nacos</span><br></pre></td></tr></table></figure>

<h3 id="六、安装MongoDB5-0-5"><a href="#六、安装MongoDB5-0-5" class="headerlink" title="六、安装MongoDB5.0.5"></a>六、安装MongoDB5.0.5</h3><h4 id="拉取镜像"><a href="#拉取镜像" class="headerlink" title="拉取镜像"></a>拉取镜像</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull mongo:5.0.15-focal</span><br></pre></td></tr></table></figure>

<h4 id="创建目录-2"><a href="#创建目录-2" class="headerlink" title="创建目录"></a>创建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">mkdir -p /data/mongo/data</span><br><span class="line">mkdir -p /data/mongo/conf</span><br><span class="line">mkdir -p /data/mongo/logs</span><br><span class="line">mkdir -p /data/mongo/configdb</span><br></pre></td></tr></table></figure>

<h4 id="编写配置文件"><a href="#编写配置文件" class="headerlink" title="编写配置文件"></a>编写配置文件</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在/data/mongo/conf目录下创建mongod.conf</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">写入以下部分，除了net部分更改，其它部分不用更改</span></span><br></pre></td></tr></table></figure>

<figure class="highlight yaml"><table><tr><td class="code"><pre><span class="line"><span class="attr">storage:</span></span><br><span class="line">   <span class="attr">dbPath:</span> <span class="string">/var/lib/mongodb</span></span><br><span class="line">   <span class="attr">journal:</span></span><br><span class="line">      <span class="attr">enabled:</span> <span class="literal">true</span></span><br><span class="line"><span class="comment"># engine:</span></span><br><span class="line"><span class="comment"># wiredTiger:</span></span><br><span class="line"></span><br><span class="line"><span class="attr">systemLog:</span></span><br><span class="line">   <span class="attr">destination:</span> <span class="string">file</span></span><br><span class="line">   <span class="attr">logAppend:</span> <span class="literal">true</span></span><br><span class="line">   <span class="attr">path:</span> <span class="string">/var/log/mongodb/mongod.log</span></span><br><span class="line"></span><br><span class="line"><span class="attr">net:</span></span><br><span class="line">   <span class="attr">bindIp:</span> <span class="number">0.0</span><span class="number">.0</span><span class="number">.0</span></span><br><span class="line">   <span class="attr">port:</span> <span class="number">27017</span></span><br><span class="line"></span><br><span class="line"><span class="attr">processManagement:</span></span><br><span class="line">   <span class="attr">timeZoneInfo:</span> <span class="string">/usr/share/zoneinfo</span></span><br></pre></td></tr></table></figure>

<h4 id="执行脚本-5"><a href="#执行脚本-5" class="headerlink" title="执行脚本"></a>执行脚本</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line">--name mongo51 \</span><br><span class="line">-p 27017:27017 \</span><br><span class="line">-v /data/mongo/data:/data/db \</span><br><span class="line">-v /data/mongo/conf/mongod.conf:/etc/mongod.conf.orig \</span><br><span class="line">-v /data/mongo/logs:/var/log/mongodb \</span><br><span class="line">-v /data/mongo/configdb:/data/configdb \</span><br><span class="line">-e MONGO_INITDB_ROOT_USERNAME=root \</span><br><span class="line">-e MONGO_INITDB_ROOT_PASSWORD=123456 \</span><br><span class="line">--privileged=true \</span><br><span class="line">--restart=always \</span><br><span class="line">-d mongo:5.0.15-focal \</span><br><span class="line">--replSet rs0</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">设置开机自启</span></span><br><span class="line">docker update --restart=always 容器ID</span><br></pre></td></tr></table></figure>

<h3 id="七、安装Minio2023-03-22"><a href="#七、安装Minio2023-03-22" class="headerlink" title="七、安装Minio2023-03-22"></a>七、安装Minio2023-03-22</h3><h4 id="拉取镜像-1"><a href="#拉取镜像-1" class="headerlink" title="拉取镜像"></a>拉取镜像</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker pull minio/minio:RELEASE.2023-03-22T06-36-24Z</span><br></pre></td></tr></table></figure>

<h4 id="创建目录-3"><a href="#创建目录-3" class="headerlink" title="创建目录"></a>创建目录</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">docker run \</span><br><span class="line"> --name minio \</span><br><span class="line"> -p 9000:9000 \</span><br><span class="line"> -p 9090:9090 \</span><br><span class="line"> --restart=always \</span><br><span class="line"> -e &quot;MINIO_ACCESS_KEY=admin&quot; \</span><br><span class="line"> -e &quot;MINIO_SECRET_KEY=12345678&quot; \</span><br><span class="line"> -v /data/minio/data:/data  \</span><br><span class="line"> -v /data/minio/conf:/root/.minio \</span><br><span class="line"> -d minio/minio:RELEASE.2023-03-22T06-36-24Z \</span><br><span class="line"> server data --console-address &quot;:9090&quot; -address &quot;:9000&quot;</span><br></pre></td></tr></table></figure>

</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://tengfei2233.gitee.io">Fei</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://tengfei2233.gitee.io/2023/6/26/Docker%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%9B%B4%E6%96%B0%E4%B8%AD-%EF%BC%89/">https://tengfei2233.gitee.io/2023/6/26/Docker%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%9B%B4%E6%96%B0%E4%B8%AD-%EF%BC%89/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://tengfei2233.gitee.io" target="_blank">飞の博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Docker/">Docker</a></div><div class="post_share"><div class="social-share" data-image="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.staticfile.org/butterfly-extsrc/1.1.3/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.staticfile.org/butterfly-extsrc/1.1.3/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/wechat.png" target="_blank"><img class="post-qr-code-img" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/wechat.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/alipay.png" target="_blank"><img class="post-qr-code-img" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/alipay.png" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/6/25/Java%E5%8E%9F%E7%94%9FNio%E6%9C%8D%E5%8A%A1%E7%AB%AF%E4%B8%8E%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%BC%96%E5%86%99/" title="Java原生Nio服务端与客户端编写"><img class="cover" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-25/Nio.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Java原生Nio服务端与客户端编写</div></div></a></div><div class="next-post pull-right"><a href="/2023/8/27/Docker%E5%9F%BA%E7%A1%80%E5%AD%A6%E4%B9%A0%E6%96%87%E6%A1%A3-%E5%8C%85%E6%8B%AC%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" title="Docker基础学习文档(包括安装教程)"><img class="cover" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Docker基础学习文档(包括安装教程)</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2023/8/27/Docker%E5%9F%BA%E7%A1%80%E5%AD%A6%E4%B9%A0%E6%96%87%E6%A1%A3-%E5%8C%85%E6%8B%AC%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" title="Docker基础学习文档(包括安装教程)"><img class="cover" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2023-08-27</div><div class="title">Docker基础学习文档(包括安装教程)</div></div></a></div><div><a href="/2023/8/27/Docker-Compose%E5%AD%A6%E4%B9%A0/" title="Docker Compose学习"><img class="cover" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2023-08-27</div><div class="title">Docker Compose学习</div></div></a></div><div><a href="/2023/8/27/Dockerfile%E5%AD%A6%E4%B9%A0/" title="Dockerfile学习"><img class="cover" src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2023-08-27</div><div class="title">Dockerfile学习</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/common/fei.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Fei</div><div class="author-info__description">当你想起来了，那就记录一点吧</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">24</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">28</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/tengfei2233"><i class="fab fa-github"></i><span>关注我</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/tengfei2233" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://gitee.com/tengfei2233" target="_blank" title="Gitee"><i class="fab fa-git"></i></a><a class="social-icon" href="/youfeige@outlook.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">当你迷茫的时候，那就静下心想想吧！</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Docker%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%9B%B4%E6%96%B0%E4%B8%AD%EF%BC%81%EF%BC%89"><span class="toc-number">1.</span> <span class="toc-text">Docker安装一些常用软件（更新中！）</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link"><span class="toc-number">1.0.1.</span> <span class="toc-text">如果有防火墙，请自行打开，避免找了半天BUG( ╯□╰ )</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%B8%8B%E4%B8%80%E7%AF%87Docker%E6%96%87%E7%AB%A0%EF%BC%9ADocker%E5%9F%BA%E7%A1%80%E5%AD%A6%E4%B9%A0%E6%96%87%E6%A1%A3-%E5%8C%85%E6%8B%AC%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B"><span class="toc-number">1.0.1.1.</span> <span class="toc-text">下一篇Docker文章：Docker基础学习文档-包括安装教程</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%AE%89%E8%A3%85MySQL8-0-22"><span class="toc-number">1.1.</span> <span class="toc-text">一、安装MySQL8.0.22</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96mysql"><span class="toc-number">1.1.1.</span> <span class="toc-text">拉取mysql</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E7%9B%AE%E5%BD%95"><span class="toc-number">1.1.2.</span> <span class="toc-text">新建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%EF%BC%88%E6%97%A5%E5%90%8E%E5%BE%85%E8%A1%A5%E5%85%85%EF%BC%89"><span class="toc-number">1.1.3.</span> <span class="toc-text">编写配置文件（日后待补充）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC"><span class="toc-number">1.1.4.</span> <span class="toc-text">执行脚本</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E5%AE%89%E8%A3%85Redis6-2-12"><span class="toc-number">1.2.</span> <span class="toc-text">二、安装Redis6.2.12</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96redis"><span class="toc-number">1.2.1.</span> <span class="toc-text">拉取redis</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E7%9B%AE%E5%BD%95-1"><span class="toc-number">1.2.2.</span> <span class="toc-text">新建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%B7%E8%B4%9D%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">1.2.3.</span> <span class="toc-text">拷贝配置文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9redis-conf"><span class="toc-number">1.2.4.</span> <span class="toc-text">修改redis.conf</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC-1"><span class="toc-number">1.2.5.</span> <span class="toc-text">执行脚本</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%AE%89%E8%A3%85RabbitMQ3-9-4"><span class="toc-number">1.3.</span> <span class="toc-text">三、安装RabbitMQ3.9.4</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96rabbitmq"><span class="toc-number">1.3.1.</span> <span class="toc-text">拉取rabbitmq</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E7%9B%AE%E5%BD%95-2"><span class="toc-number">1.3.2.</span> <span class="toc-text">新建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC-2"><span class="toc-number">1.3.3.</span> <span class="toc-text">执行脚本</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E5%BB%B6%E8%BF%9F%E9%98%9F%E5%88%97%E6%8F%92%E4%BB%B6"><span class="toc-number">1.3.4.</span> <span class="toc-text">添加延迟队列插件</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E5%AE%89%E8%A3%85Nginx"><span class="toc-number">1.4.</span> <span class="toc-text">四、安装Nginx</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96nginx"><span class="toc-number">1.4.1.</span> <span class="toc-text">拉取nginx</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95"><span class="toc-number">1.4.2.</span> <span class="toc-text">创建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%B7%E8%B4%9D%E6%96%87%E4%BB%B6"><span class="toc-number">1.4.3.</span> <span class="toc-text">拷贝文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%A0%E9%99%A4%E5%AE%B9%E5%99%A8"><span class="toc-number">1.4.4.</span> <span class="toc-text">删除容器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC-3"><span class="toc-number">1.4.5.</span> <span class="toc-text">执行脚本</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BB%A5%E4%B8%8B%E5%8F%AF%E9%80%89-%E9%85%8D%E7%BD%AESSL"><span class="toc-number">1.4.6.</span> <span class="toc-text">(以下可选*)配置SSL</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E7%9B%B8%E5%85%B3%E4%BF%A1%E6%81%AF"><span class="toc-number">1.4.7.</span> <span class="toc-text">配置相关信息</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BA%94%E3%80%81%E5%AE%89%E8%A3%85Nacos2-1-2"><span class="toc-number">1.5.</span> <span class="toc-text">五、安装Nacos2.1.2</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96nacos"><span class="toc-number">1.5.1.</span> <span class="toc-text">拉取nacos</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95-1"><span class="toc-number">1.5.2.</span> <span class="toc-text">创建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AF%BC%E5%85%A5SQL%EF%BC%88%E5%A6%82%E6%9E%9C%E4%B8%8D%E4%BD%BF%E7%94%A8MySQL%E7%9A%84%E8%AF%9D%E8%BF%99%E6%AD%A5%E5%8F%AF%E4%BB%A5%E5%BF%BD%E7%95%A5%EF%BC%89"><span class="toc-number">1.5.3.</span> <span class="toc-text">导入SQL（如果不使用MySQL的话这步可以忽略）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC-4"><span class="toc-number">1.5.4.</span> <span class="toc-text">执行脚本</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AE%BF%E9%97%AE"><span class="toc-number">1.5.5.</span> <span class="toc-text">访问</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%AD%E3%80%81%E5%AE%89%E8%A3%85MongoDB5-0-5"><span class="toc-number">1.6.</span> <span class="toc-text">六、安装MongoDB5.0.5</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96%E9%95%9C%E5%83%8F"><span class="toc-number">1.6.1.</span> <span class="toc-text">拉取镜像</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95-2"><span class="toc-number">1.6.2.</span> <span class="toc-text">创建目录</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">1.6.3.</span> <span class="toc-text">编写配置文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%84%9A%E6%9C%AC-5"><span class="toc-number">1.6.4.</span> <span class="toc-text">执行脚本</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%83%E3%80%81%E5%AE%89%E8%A3%85Minio2023-03-22"><span class="toc-number">1.7.</span> <span class="toc-text">七、安装Minio2023-03-22</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8B%89%E5%8F%96%E9%95%9C%E5%83%8F-1"><span class="toc-number">1.7.1.</span> <span class="toc-text">拉取镜像</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95-3"><span class="toc-number">1.7.2.</span> <span class="toc-text">创建目录</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/11/21/netty%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%EF%BC%8C%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90%EF%BC%8C%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3-%E6%9B%B4%E6%96%B0%E4%B8%AD/" title="netty的基本使用，基本原理分析，相关问题解(更新中...)"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-11-10/netty-ai.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="netty的基本使用，基本原理分析，相关问题解(更新中...)"/></a><div class="content"><a class="title" href="/2023/11/21/netty%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%EF%BC%8C%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86%E5%88%86%E6%9E%90%EF%BC%8C%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3-%E6%9B%B4%E6%96%B0%E4%B8%AD/" title="netty的基本使用，基本原理分析，相关问题解(更新中...)">netty的基本使用，基本原理分析，相关问题解(更新中...)</a><time datetime="2023-11-21T09:27:51.000Z" title="发表于 2023-11-21 17:27:51">2023-11-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/11/10/%E5%9C%A8conda%E7%8E%AF%E5%A2%83%E4%B8%8B%E8%BF%90%E8%A1%8Cstable-diffusion-webui-AI%E7%BB%98%E5%9B%BE/" title="在conda环境下运行stable-diffusion-webui AI绘图"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-11-10/ai.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="在conda环境下运行stable-diffusion-webui AI绘图"/></a><div class="content"><a class="title" href="/2023/11/10/%E5%9C%A8conda%E7%8E%AF%E5%A2%83%E4%B8%8B%E8%BF%90%E8%A1%8Cstable-diffusion-webui-AI%E7%BB%98%E5%9B%BE/" title="在conda环境下运行stable-diffusion-webui AI绘图">在conda环境下运行stable-diffusion-webui AI绘图</a><time datetime="2023-11-10T07:30:51.000Z" title="发表于 2023-11-10 15:30:51">2023-11-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/11/10/%E5%9C%A8Ubuntu20%E4%B8%8A%E5%AE%89%E8%A3%85CUDA-cuDNN-Miniconda%E7%8E%AF%E5%A2%83(%E5%85%B6%E5%AE%83%E7%B3%BB%E7%BB%9F%E5%90%8C%E7%90%86)/" title="在Ubuntu20上安装CUDA+cuDNN+Miniconda环境(其它系统同理)"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-11-10/ai.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="在Ubuntu20上安装CUDA+cuDNN+Miniconda环境(其它系统同理)"/></a><div class="content"><a class="title" href="/2023/11/10/%E5%9C%A8Ubuntu20%E4%B8%8A%E5%AE%89%E8%A3%85CUDA-cuDNN-Miniconda%E7%8E%AF%E5%A2%83(%E5%85%B6%E5%AE%83%E7%B3%BB%E7%BB%9F%E5%90%8C%E7%90%86)/" title="在Ubuntu20上安装CUDA+cuDNN+Miniconda环境(其它系统同理)">在Ubuntu20上安装CUDA+cuDNN+Miniconda环境(其它系统同理)</a><time datetime="2023-11-10T07:27:51.000Z" title="发表于 2023-11-10 15:27:51">2023-11-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/8/27/Docker-Compose%E5%AD%A6%E4%B9%A0/" title="Docker Compose学习"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Docker Compose学习"/></a><div class="content"><a class="title" href="/2023/8/27/Docker-Compose%E5%AD%A6%E4%B9%A0/" title="Docker Compose学习">Docker Compose学习</a><time datetime="2023-08-27T15:34:50.000Z" title="发表于 2023-08-27 23:34:50">2023-08-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/8/27/Dockerfile%E5%AD%A6%E4%B9%A0/" title="Dockerfile学习"><img src="https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Dockerfile学习"/></a><div class="content"><a class="title" href="/2023/8/27/Dockerfile%E5%AD%A6%E4%B9%A0/" title="Dockerfile学习">Dockerfile学习</a><time datetime="2023-08-27T15:34:37.000Z" title="发表于 2023-08-27 23:34:37">2023-08-27</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://blog-1306275892.cos.ap-shanghai.myqcloud.com/hexo/blogs/2023-6-26/docker.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2022 - 2024 By Fei</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">欢迎进入<a href="tengfei2233.gitee.io/">飞の博客</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="https://cdn.staticfile.org/hexo-theme-butterfly/4.7.0/js/utils.min.js"></script><script src="https://cdn.staticfile.org/hexo-theme-butterfly/4.7.0/js/main.min.js"></script><script src="https://cdn.staticfile.org/hexo-theme-butterfly/4.7.0/js/tw_cn.min.js"></script><script src="https://cdn.staticfile.org/fancyapps-ui/4.0.31/fancybox.umd.min.js"></script><script src="https://cdn.staticfile.org/instant.page/5.1.1/instantpage.min.js" type="module"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.staticfile.org/pangu/4.0.7/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: '0kbeJfFlvhvkYfqMqwwVCx1a-gzGzoHsz',
      appKey: 'rziWUw1MTHMW7d9eeCQzu9HV',
      avatar: 'monsterid',
      serverURLs: '',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.staticfile.org/valine/1.5.1/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script defer="defer" id="ribbon" src="https://cdn.staticfile.org/butterfly-extsrc/1.1.3/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="true"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div><script src="https://cdn.staticfile.org/hexo-theme-butterfly/4.7.0/js/search/local-search.min.js"></script></div></body></html>